home *** CD-ROM | disk | FTP | other *** search
/ FishMarket 1.0 / FishMarket v1.0.iso / fishies / 076-100 / disk_087 / dropshadow / myhooks.c < prev    next >
C/C++ Source or Header  |  1992-05-06  |  1KB  |  100 lines

  1. /* myhooks.c -- set up layers vector stealing    */
  2.  
  3. typedef    LONG    (*PFL)();
  4.  
  5. struct    hook    {
  6.     LONG    hk_SysFunc;
  7.     PFL        hk_MyFunc;
  8.     PFL        hk_Entry;    /* unique entry point    */
  9.     WORD    hk_Test;
  10.     LONG    hk_LVO;
  11. };
  12.  
  13. void    drawShadowSignal();
  14.  
  15. /* unique entry points    */
  16. long    entry0();
  17. long    entry1();
  18. long    entry2();
  19. long    entry3();
  20. long    entry4();
  21. long    entry5();
  22. long    entry6();
  23.  
  24. struct hook    myhooks[] = {
  25.     {    0,    
  26.         (PFL) drawShadowSignal,
  27.         entry0,
  28.         0,
  29.         -48,        /* upfront            */
  30.     },
  31.     {    0,    
  32.         (PFL) drawShadowSignal,
  33.         entry1,
  34.         0,
  35.         -42            /* create behind    */
  36.     },
  37.     {    0,    
  38.         (PFL) drawShadowSignal,
  39.         entry2,
  40.         0,
  41.         -36            /* create upfront    */
  42.     },
  43.     {    0,    
  44.         (PFL) drawShadowSignal,
  45.         entry3,
  46.         0,
  47.         -90            /* delete            */
  48.     },
  49.     {    0,    
  50.         (PFL) drawShadowSignal,
  51.         entry4,
  52.         0,
  53.         -54            /* behind            */
  54.     },
  55.     {    0,    
  56.         (PFL) drawShadowSignal,
  57.         entry5,
  58.         0,
  59.         -66            /* size             */
  60.     },
  61.     {    0,    
  62.         (PFL) drawShadowSignal,
  63.         entry6,
  64.         0,
  65.         -60            /* move             */
  66.     }
  67. };
  68.  
  69. #define NUMHOOKS    (sizeof (myhooks)/ sizeof (struct hook))
  70.  
  71. extern    long    LayersBase;
  72.  
  73. setup_hooks()
  74. {
  75.     int        i;
  76.  
  77.     /* install the hooks    */
  78.     Forbid();
  79.     for (i = 0; i < NUMHOOKS; ++i)
  80.     {
  81.         myhooks[i].hk_SysFunc =
  82.             SetFunction(LayersBase, myhooks[i].hk_LVO, myhooks[i].hk_Entry);
  83.     }
  84.     Permit();
  85. }
  86.  
  87. cleanup_hooks()
  88. {
  89.     int    i;
  90.  
  91.     /* remove the hooks        */
  92.     /*** ZZZZ need to see if vectors are still mine    ***/
  93.     for (i = 0; i < NUMHOOKS; ++i)
  94.     {
  95.         SetFunction(LayersBase, myhooks[i].hk_LVO, myhooks[i].hk_SysFunc);
  96.     }
  97.  
  98.     return (1);        /* tell him it's ok to exit    */
  99. }
  100.